<div class="">
    <div class="admin_nrtop">
        <div class="ad_search">
            <div class="search">
                <form action="/admini/express/index/"  method="get" style="margin:0px" id="form1">
                    <div class="soubox">
                        <input type="text" id="name" name="name" value="<?php echo $this->name?$this->name:"";?>" placeholder="输入快递名称">
                    </div>
                    <a href="javascript:$('#form1').submit();"><span>搜索</span></a>
                </form>
            </div>
        </div>
    </div>
    <div class="couriercommpany">
        <table>
            <tbody>
                <tr>
                    <th class="cc1">快递logo</th>
                    <th class="cc2">快递名称</th>
                    <th class="cc3">可走敏感项</th>
                    <th class="cc4">是否按体积</th>
                    <th class="cc5">运输时间(工作日)</th>
                    <th class="cc6">是否要发票</th>
                    <th class="cc7">燃油费</th>
                    <th class="cc8">偏远费</th>
                    <th class="cc9">其他费用</th>
                    <th class="cc10">操作</th>
                </tr>
        <?php if($this->expressList){
                foreach ($this->expressList as $Item) { ?> 
                <tr>
                    <td class="cc1">
                        <div class="cclogo">
                            <?php if($Item->logo){ ?>
                                <img  src="<?php echo $Item->logo; ?>" height="60px" width="120px" />
                            <?php }else{ ?>
                                无logo图
                            <?php } ?>
                        </div>
                    </td>
                    <td class="cc2">
                        <div class="ccname">
                            <h2>
                                <a href="/admini/express/epdetail/id/<?php echo $Item->Id;?>" class="indexa"><?php echo $Item->Name;?></a>
                                <?php if($Item->IsDisable == 1){?><span style="color:red">(已禁用)</span><?php }?>
                            </h2>
                        </div>
                    </td>
                    <td class="cc3"><p> <?php echo $Item->ItemTypeName; ?> </p></td>
                    <td class="cc4"> <?php echo $Item->VolumeName;?> </td>
                    <td class="cc5"> <?php echo $Item->Es_time;?> </td>
                    <td class="cc6"> <?php echo $Item->InvoiceName;?> </td>
                    <td class="cc7"> <?php echo (float)$Item->fuelSurcharge > 0 ? ((float)$Item->fuelSurcharge) * 100 .'%' : '无' ;?> </td>
                    <td class="cc8"> <?php echo $Item->isRemoteFee == 1 && (float)$Item->remoteFee > 0 ? '燃油费 + ' . (float)$Item->remoteFee : '无'; ?> </td>
                    <td class="cc9"> <?php echo (float)$Item->othersFee > 0 ? (float)$Item->othersFee : '无'; ?> </td>
                    <td class="cc10">
                        <p class="ccnav">
                            <a href="/admini/express/addexpress/id/<?php echo $Item->Id;?>" data-id="<?php echo $Item->Id;?>" >编辑</a>
                            <span>|</span>
                            <?php if($Item->IsDisable == 1){?>
                                <a href="javascript:void(0)" name="<?php echo $Item->id;?>" class="EnableOrDisable" i="启用">启用</a>
                            <?php } else { ?>
                                <a href="javascript:void(0)" name="<?php echo $Item->id;?>" class="EnableOrDisable" i="禁用">禁用</a>
                            <?php } ?>
                            <span>|</span>
                            <a href="/admini/express/vipview/id/<?php echo $Item->Id;?>" data-id="<?php echo $Item->Id;?>" >查看vip折扣</a>
                        </p>
                    </td>
                </tr>
            <?php 
                    }
                }else{
                    echo "<font size='4' color='red'>暂无数据</font>";
                }
            ?>
            </tbody>
        </table>
    </div>
    <div class="ccbar">
        <a class="ccbotton" href="/admini/express/addexpress" id="addExpress" name="addExpress"><span>添加快递</span></a></li>
    <?php
        echo $this->partial('paging.phtml', array("pages" => $this->expressAll,"pamas"=>"name=$this->name&isVolume=$this->isVolume&isDisable=$this->isDisable&isInvoice=$this->isInvoice&isRemoteFee=$this->isRemoteFee"));        
    ?>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        //禁用或启用
        $(".EnableOrDisable").click(function(){
            var id = $(this).attr('name');
            var i = $(this).attr("i");
            if(confirm("您确定"+i+"该快递？","提示信息")){
                $.ajax({    
                    type: 'POST',
                    url: '/admini/express/enableordisable/id/'+id,
                    success: function(data) {
                        if(data == 1){
                            alert(i+"成功！");
                            location.reload();
                        }else{
                            alert("发生未知错误，请重新操作");
                        }
                    }
                });
            }
        });
    })
</script>